<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ActivateYourGlutes.Services.Model.MeasurementType>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Measurement Types
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div id="subheader">
        <h2>Measurement Types</h2>
        <div>            
            <%= Html.ActionLink("Your Profile", MVC.Account.Index()) %>
        </div>
    </div>

    <table>
        <tr>
            <th></th>
            <th>
                Description
            </th>            
            <th>
                Unit
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
            <% if (!item.IsSystem) { %>
                <%= Html.ActionLink("Delete", MVC.MeasurementType.ConfirmDelete(item.MeasurementTypeId))%>
            <% } else { %>
                &nbsp;
            <% } %>
            </td>
            <td>
                <%= Html.Encode(item.Description) %>
            </td>
            <td>
                <%= Html.Encode(item.Unit) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Add Measurement Type", MVC.MeasurementType.Create()) %>
    </p>

</asp:Content>

